from zvt.domain import *

# Stock.record_data(provider="em")
# df = Stock.query_data(provider="em", index='code')
# print(df)

# df = FinanceFactor.query_data(filters=[FinanceFactor.roe > 0.08, FinanceFactor.report_period == 'year',
#                                        FinanceFactor.op_income_growth_yoy > 0.08], start_timestamp='2019-01-01',
#                                        end_timestamp='2020-01-01',
#                               order=FinanceFactor.roe.desc(), limit=20,
#                               columns=["code"] + FinanceFactor.important_cols(), index='code')
# print(df)

df = StockValuation.query_data(filters=[StockValuation.market_cap <= 4000000,
                                       FinanceFactor.op_income_growth_yoy > 0.08], start_timestamp='2022-11-26',
                                       end_timestamp='2020-01-01',
                              order=FinanceFactor.roe.desc(), limit=20,
                              columns=["code"] + FinanceFactor.important_cols(), index='code')
print(df)